import { ReqCategoryList,ReqSlideList,ReqFloorList} from '@/api/index'
const state ={
    categoryList:[],
    slide:[],
    floor:[],
}
const mutations ={ 
    SAVE_CATEGORY_LIST(state,value){
        state.categoryList = value
    },
    SAVE_SLIDE_LIST(state,value){
        state.slide = value
    },
    SAVE_FLOOR_LIST(state,value){
        state.floor = value
    },
}
const actions ={
    
    // 请求三级分类
    async asyncGetCategoryList ({commit}){
       let data = await ReqCategoryList();
       commit ('SAVE_CATEGORY_LIST',data)
    },
    // 请求轮播图
    async asyncGetSlideList ({commit}){
        let data = await ReqSlideList();
        commit('SAVE_SLIDE_LIST',data)
    },
    // 请求楼层
    async asyncGetFloorList({commit}){
        let data = await ReqFloorList()
        commit('SAVE_FLOOR_LIST',data)
    },
}

export default {
    namespaced:true,
    state,
    mutations,
    actions
}
